const Router = require('koa-router')
const { login, register } = require('../controller/user.controller')
const { userValidator, verifyUser, cryptPassword, verifyLogin } = require('../middleware/user.middleware')

const router = new Router({prefix : '/users'})

//登录
router.post('/login',userValidator, verifyLogin, login)

//注册
router.post('/register', userValidator, verifyUser, cryptPassword, register)

module.exports = router